<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Feedback
 *
 * @author thanhlnh
 */
class Model_Feedback {
    static $TABLE_NAME = 'user_feedback';
    public function insert_new_feedback($data){
        if (!empty($data)) {
            $db = Model_Connections::getInstance()->getDbConnect();
            $numRows = $db->insert(self::$TABLE_NAME, $data);
            $lastInsertId = -1;
            if ($numRows > 0)
                $lastInsertId = $db->lastInsertId();
            return $lastInsertId;
        }
    }
    
    public function get_feed_by_id($id) {
        $db = Model_Connections::getInstance()->getDbConnect();
        $sql = "Select * from " . self::$TABLE_NAME;
        $sql .= ' where id = ' . $id;
        $data = $db->fetchAll($sql);
        return $data;
    }
}

?>
